﻿using System.Collections.Generic;
using System.Web.Mvc;
using GC_RF.Domain.Abstractions.Interfaces.Factories;
using GC_RF.Domain.Enums;
using GC_RF.Site.Abstractions;
using GC_RF.Site.Attributes;
using GC_RF.Site.Helpers;
using GC_RF.Site.Models.Shared;
using GC_RF.Site.Resources.Constants;

namespace GC_RF.Site.Controllers
{
	[UserAuthorize(UserRoles = UserRole.Administrator | UserRole.Moderator)]
	public class AdminController : BaseController
	{
		#region Variables

		#endregion

		#region Constructors

		public AdminController(IServiceFactory serviceFactory)
			: base(serviceFactory) { }

		#endregion

		#region Actions

		[Route("admin-panel")]
		public ActionResult Settings()
		{
			var model = new ServicesModel();
			FillSettingsModel(model);
			return View(model);
		}

		#endregion

		#region Internal Implementation

		private void FillSettingsModel(ServicesModel model)
		{
			if (model == null) return;

			model.Description = "Панель администратора";
			model.Items = new List<ServicesItemModel>
			{
				new ServicesItemModel
				{
					Class = FontAwesomClasses.FileTextO,
					Header = "Новости",
					Description = "Добавление новостей на сайт",
					Url = WebBuilder.BuildActionUrl<NewsController>(m => m.Edit((int?)null))
				}
			};
		}

		#endregion
	}
}